package com.itheima.stock.controller;

import com.itheima.stock.api.UserControllerAPI;
import com.itheima.stock.dto.LoginDTO;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.UserService;
import com.itheima.stock.vo.CaptchaVO;
import com.itheima.stock.vo.LoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ZgYn
 * @Date 2025/10/21 20:25
 * @Name UserController
 */
@RestController
public class UserController implements UserControllerAPI {

    @Autowired
    private UserService userService;
    @Override
    public ResponseResult<CaptchaVO> generateCaptcha() {
        return ResponseResult.ok(userService.generateCaptcha());
    }
    @Override
    public ResponseResult<LoginVO> login(LoginDTO dto) {
        return ResponseResult.ok(userService.login(dto));
    }
}
